<?php
include_once("functions/db_manipulate.php");

if (!init()) {
    redirect("?action=login");
    exit();
}

?>

    <meta charset="UTF-8">
<?php

$uploadfile = getcwd() . '/img/main_bg.jpg'; //Change fly-fishing-forum to the site name

$acceptedFormats = array('gif', 'png', 'jpg', 'jpeg');

unlink($uploadfile);

if (isset($_FILES['image'])) {

    if (in_array(strtolower(pathinfo($_FILES['image']['name'], PATHINFO_EXTENSION)), $acceptedFormats)) {

        if (move_uploaded_file($_FILES['image']['tmp_name'], $uploadfile)) {

        }
    }
}

redirect($_SERVER['HTTP_REFERER']);


